package com.cike.productmanager;

import java.io.File;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;

import com.cike.productmanager.util.DataApplication;

public class WelcomeActivity extends Activity {

	private static long DALEYMILLIS = 3000; 
	
	public static final File SAVEPATH = new File(Environment.getExternalStorageDirectory() + "/ProductChannelmanager");
	public static File proFile=null;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.welcome);
		
		
        new Handler().postDelayed(new Runnable() {  
        	public void run() {
        		
        		//初始化DataApplication
        		DataApplication.RemoveDataAll();
        		DataApplication.Init();
        		//转到登陆界面
        		tologin();
        	}  
        }, DALEYMILLIS); 
		
	}

	
	private void tologin() {
		Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
		startActivity(intent);
		WelcomeActivity.this.finish(); 
		overridePendingTransition(R.anim.myanim_in,R.anim.myanim_out);
	}
}
